import { Actor } from '../Actor';
import { NodeCanvasRenderingContext2D } from 'canvas';
import { Pair } from '../types/Pair';

export class Rectangle extends Actor {
	constructor(private x: number, private y: number, private w: number, private h: number, private color: string) {
		super();
	}

	_paint(p: Record<string, number>, ctx: NodeCanvasRenderingContext2D, frame: number, time: number): void {
		const pos = new Pair(this.x, this.y);
		ctx.fillStyle = this.color;
		ctx.fillRect(p.x, p.y, this.w, this.h);
	}
}
